<!DOCTYPE html>
<html>


<!-- Mirrored from www.zi-han.net/theme/hplus/table_data_tables.html by HTTrack Website Copier/3.x [XR&CO'2014], Wed, 20 Jan 2016 14:20:01 GMT -->

<head>

    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">


    <title>对账接入者管理系统</title>
    <meta name="keywords" content="对账接入者管理系统">
    <meta name="description" content="对账接入者管理系统">

    <link rel="shortcut icon" href="{{asset('dealer/img/favicon.ico')}}">
    <link href="{{asset('dealer/css/bootstrap.min.css')}}" rel="stylesheet">
    <link href="{{asset('dealer/css/font-awesome.min.css')}}" rel="stylesheet">

    <!-- Data Tables -->
    <link href="{{asset('dealer/css/plugins/dataTables/dataTables.bootstrap.css')}}" rel="stylesheet">

    <link href="{{asset('dealer/css/animate.min.css')}}" rel="stylesheet">
    <link href="{{asset('dealer/css/style.min.css')}}" rel="stylesheet">

    <link href="{{asset('dealer/css/plugins/datapicker/datepicker3.css')}}" rel="stylesheet">

    <link rel="stylesheet" type="text/css" href="{{asset('layui/src/css/layui.css')}}" />
</head>

<body class="gray-bg">
<style>
    table.dataTable thead .sorting:after {
        content: "";
    }

    table.dataTable,
    .table-bordered {
        text-align: center;
    }
</style>
<div class="wrapper wrapper-content animated fadeInRight">
    <div class="row">
        <div class="col-sm-12">
            <div class="ibox float-e-margins">
                <div class="ibox-title" style="padding-bottom: 40px">
                            <div class="col-sm-3">
                                <h5 style="margin:7px 0 0;font-size: 16px;"><span id="cname" style="font-size: 16px;"></span>交易记录</h5>
                           </div>
                          <div class="col-sm-4">
                                <strong style="font-size: 20px">收益总额：
                             <i class="fa fa-cny"></i>
                                      <span id="income" style="font-size: 20px"></span>元</strong>
                              </div>
                          <div class="col-sm-5">
                                  <a class="btn btn-success btn-rounded" href="{{asset('C_deal')}}" style="float: right;margin: 0">返回</a>
                                 </div>
                             </div>



                <div class="ibox-content">
                    <div class="row" style="margin-bottom: 5px">
                        <!--
                         <div class="col-sm-6">
                            <strong>熊宝宝</strong>
                        </div>
                        <div class="col-sm-6">
                            <strong style="float: right;font-size: 20px">剩余金额：
                                <span id="" style="font-size: 20px">4800</span>元</strong>
                        </div>
                        !-->
                    </div>
                    <table class="table table-striped table-bordered table-hover dataTables-example">
                        <thead>
                        <tr>
                            <th style="text-align: center;">
                                <strong>序号</strong>
                            </th>
                            <th style="text-align: center;">
                                <strong>类型</strong>
                            </th>
                            <th style="text-align: center;">
                                <strong>收益总金额（元）</strong>
                            </th>
                        </tr>
                        </thead>
                        <tbody id="tbody-content">

                        <tr>
                            <td class="center">1</td>
                            <td class="center">合同</td>
                            <td class="center">
                                <i class="fa fa-cny"></i>&nbsp;123456
                            </td>
                        </tr>

                        </tbody>
                    </table>

                    <div class="row">
                        <div id="pages" style="float: right;"></div>
                    </div>
                </div>
            </div>
        </div>
    </div>
    <input name="id" id="hid" type="hidden" value="{{$id}}">
</div>
<script src="{{asset('dealer/js/jquery.min.js')}}"></script>
<script src="{{asset('dealer/js/bootstrap.min.js')}}"></script>
<script src="{{asset('dealer/js/plugins/jeditable/jquery.jeditable.js')}}"></script>

<script src="{{asset('dealer/js/content.min.js')}}"></script>
<script type="text/javascript" src="{{asset('lib/laypage/1.2/laypage.js')}}"></script>
<script type="text/javascript" src="{{asset('layui/src/layui.js')}}"></script>
<script>


    function fnClickAddRow() {
        $("#editable").dataTable().fnAddData(["Custom row", "New row", "New row"])
    };



    $(document).ready(function () {
        var sum = "";
        var id=$('#hid').val();
        // alert(id)
        $.ajax({
            method: "POST",
            url: "c_deal_details",
            data: {"id":id,"type":"1","pageSize": 5, "pages": 1,'_token':'{{csrf_token()}}'},
            // async: false,
            dataType: "json",
            success:function (eval) {
                if ( eval.code == '200' ) {
                    sum = eval.data.total;
                    console.log('sum='+eval.data.total);
                } else if ( eval.code == '666' ) {
                    loginFaild();
                }
            }
        });


        layui.use('laypage', function(){
            var laypage = layui.laypage;

            //总页数大于页码总数
            laypage.render({
                elem: 'pages'
                ,count: sum //数据总数
                ,jump: function(obj){
                    console.log(obj.curr)
                    $.ajax({
                        method: "POST",
                        url: "c_deal_details",
                        data: {"id":id,"type":"1","pageSize": 5, "pages": obj.curr,'_token':'{{csrf_token()}}'  },
                        dataType: "json",
                        success:function (eval) {
                            if ( eval.code == '200' ) {




                                $('#tbody-content').html("");
                                $.each(eval.data.records, function (index, item) {
                                    $('#cname').html( item.name);
                                    $('#income').html(item.count);


                                    if(item.commissionType==0){
                                        item.commissionType='基础保全';
                                    }else if(item.commissionType==1){
                                        item.commissionType='合同 ';
                                    }else if(item.commissionType==2){
                                        item.commissionType='凭证 ';
                                    }else if(item.commissionType==3){
                                        item.commissionType='溯源 ';
                                    }

                                    var html = '<tr >\n' +
                                        '                <td class="center">' + parseInt(index+1) + '</td>\n' +
                                        '                <td class="center">' + item.commissionType + '</td>\n' +
                                        '                <td class="center">\n' +
                                        '                    <i class="fa fa-cny">' + item.totalAmount + '</i>\n' +
                                        '                </td>\n'
                                    ;
                                    $('#tbody-content').append(html);
                                });



                            }
                        }
                    });
                }
            });
        });



    })







</script>


</body>


<!-- Mirrored from www.zi-han.net/theme/hplus/table_data_tables.html by HTTrack Website Copier/3.x [XR&CO'2014], Wed, 20 Jan 2016 14:20:02 GMT -->

</html>